package com.shhm.system.controller;

import com.shhm.common.dto.response.AjaxResult;
import com.shhm.common.dto.response.AjaxResultPlus;
import com.shhm.common.entity.system.SysMenu;
import com.shhm.system.service.SysUserRoleService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author JackZ
 * @version 1.0
 * @description: 权限相关接口
 * @date 2025/7/16 下午3:19
 */
@RestController
@RequestMapping("/system")
public class SysUserRoleController {
    @Resource
    private SysUserRoleService sysUserRoleService;

    @GetMapping("/upermi/{uid}")
   public AjaxResult getUserPermission(@PathVariable Long uid) {
       return sysUserRoleService.getPermission(uid);
   }

   @GetMapping("/user/router/{uid}")
   public AjaxResultPlus getRouterList(@PathVariable Long uid){
       List<SysMenu> res= sysUserRoleService.getRouterList(uid);
       return AjaxResultPlus.custom(200,false).put("data",res);
   }

}
